package edu.pku.sei.autounit.reflect.java;

import java.util.Map;

import edu.pku.sei.autounit.reflect.AbstractType;
import edu.pku.sei.autounit.reflect.Primitive;
import edu.pku.sei.autounit.util.Log;

public class JavaPrimitive extends AbstractType implements Primitive{

	private String name;
	public JavaPrimitive(String name){
		if(!isPrimitive(name))
			Log.findBug("JavaPrimitive", "JavaPrimitive", name+" is not a primitive type");
		this.name = name;
	}
	
	public String getName(Map<String,String> map) {
		return name;
	}

	private boolean isPrimitive(String name){
		if(name.equals("boolean")
		 ||name.equals("byte")
		 ||name.equals("char")
		 ||name.equals("short")
		 ||name.equals("int")
		 ||name.equals("long")
		 ||name.equals("float")
		  ||name.equals("double")
		 )
			return true;
		else
			return false;
	}

	public String getFullName() {
		return name;
	}
}
